package com.zg.ktcomwan.data

import com.zg.ktcomwan.model.ArticleBean
import com.zg.ktcomwan.model.ProjectCategoryBean
import com.zg.ktcomwan.test.TestBean
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

/***
 * @Author:      zxd
 * @CreateDate:  2021/6/2 15:01
 * @Description:
 */
interface IApiService {

    //首页文章列表，从0开始
    @GET("article/list/{page}/json")
    suspend fun getHomeArticleList1(@Path("page") page: Int): BaseResp<BaseListResp<ArticleBean>>

    @GET("article/list/0/json")
    suspend fun getHomeArticleList(): BaseResp<BaseListResp<ArticleBean>>

    //项目分类
    @GET("project/tree/json")
    suspend fun getProjectCategory(): BaseResp<List<ProjectCategoryBean>>

    //项目
    @GET("project/list/{page}/json")
    suspend fun getProjectList(
        @Path("page") page: Int,
        @Query("cid") cid: Int
    ): BaseResp<BaseListResp<ArticleBean>>

    @GET("project/list/{page}/json")
    suspend fun getProjectListTest(
        @Path("page") page: Int,
        @Query("cid") cid: Int
    ): TestBean

    //广场的页码是从0开始的
    @GET("user_article/list/{page}/json")
    suspend fun getSquareList(@Path("page") page: Int): BaseResp<BaseListResp<ArticleBean>>
}